#!/bin/bash

if [ "$2" == "nonhvigor" ]; then
    grep -rn -P "(ohos_hap_assist_suite)|(ohos_js_hap_suite)" $(find $1 -name BUILD.gn) | awk -F ':' '{print $1}' | xargs dirname | sort -u
elif [ "$2" == "hvigor" ]; then
    find $1 -name hvigor-config.json5 | xargs dirname | xargs dirname
else
    exit 1
fi